package com.piece.blog.event;

import com.piece.blog.model.Article;
import lombok.Getter;
import lombok.Setter;
import org.springframework.context.ApplicationEvent;

/**
 *   文章发布、更新、删除事件监听
 */
@Getter
@Setter
public class ArticlePostEvent extends ApplicationEvent {

    public ArticlePostEvent(Object source) {
        super(source);
    }

    /** 发布事件 **/
    public final static int ACTION_PUBLISH = 1;

    /** 更新事件 **/
    public final static int ACTION_UPDATE = 2;

    /** 删除事件 **/
    public final static int ACTION_DELETE = 3;

    /** 收藏事件 **/
    public final static int ACTION_FAVOR = 4;

    /** 评论事件 **/
    public final static int ACTION_COMMENT = 5;

    /** 阅读事件 **/
    public final static int ACTION_VIEW = 6;

    private Article article;

    private int action = ACTION_PUBLISH;
}
